package com.justnow.offer.usercglib;

import net.sf.cglib.proxy.Enhancer;

/**
 * @author justnow
 * Created on 2020-09-05
 * Description
 */
public class CglibClient {
    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(HelloService.class);
        enhancer.setCallback(new CglibMethodInterceptor());
        HelloService proxy = (HelloService) enhancer.create();
        proxy.sayHello();
        proxy.sayBye();
    }
}
